home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / MAKERUN.SC < prev    next >
Text File  |  1993-06-07  |  71KB  |  1,157 lines

  1. ; ───────────────────────────────────────────────────────────────────────────────────────
  2. ;  GENERIC UTILITY TO AUTOMATICALLY CREATE RUNTIME VERSIONS OF ANY PARADOX APPLICATION
  3.  
  4. ; Copyright 1993                     Virginia B. Sauer                All Rights Reserved
  5. ; This program may be copied/modified without charge provided both that this
  6. ; copyright notice is included without change, and that any accompanying
  7. ; documentation includes the notice "Portions of code (c) Copyright 1993,
  8. ; Virginia B. Sauer"
  9. ; ───────────────────────────────────────────────────────────────────────────────────────
  10.  
  11.  
  12. ; Many developers cringe at the ominous words, "Let's give them a runtime version",
  13. ; usually uttered with the expectation that it will be ready in thirty minutes.
  14.  
  15. ; This generic utility was therefore designed to automate the process for any Paradox
  16. ; application.  It supports RDA, and automatically provides simple, user-friendly
  17. ; menu-driven installation routines.
  18.  
  19. ; In addition to being able to provide instant gratification whenever a client or
  20. ; Management suddenly decides to produce a runtime version, this will enable one to
  21. ; incorporate menu options to automatically generate copies whenever desired.
  22.  
  23. ; The only caveat is that runtime versions prior to 4.0 will not support wait queries.
  24. ; However, queries-by-form can easily be substituted (and are far more intuitive to most
  25. ; users).  A freeware generic adhoc querying utility appeared in a previous issue of this
  26. ; publication.
  27.  
  28. ; To convert interactive systems to runtime, it will also be necessary to change all
  29. ; instances of command Echo to TKEcho.  (The latter is a formerly undocumented PAL
  30. ; command included with Paradox Runtime, and recently made public by Borland.)
  31.  
  32. ; This can quickly and effortlessly be handled with virtually any word processor or text
  33. ; editor, including Paradox 4's script editor.  Most such products will enable you to
  34. ; automatically change all occurrences within all of the script files at once.
  35.  
  36. ; Since TKEcho will work in both runtime and interactive Paradox, most developers simply
  37. ; use TKEcho in all code to ensure that every application is "version independent" and
  38. ; will work in either runtime or interactive Paradox.
  39.  
  40.  
  41. ; ───────────────────────────────────────────────────────────────────────────────────────
  42. ;               *************** I M P O R T A N T   N O T E ***************
  43. ; ───────────────────────────────────────────────────────────────────────────────────────
  44.  
  45. ; This utility requires a runtime version of Paradox that has been configured to match
  46. ; your coding constraints - e. g., whether or not your code is dependent upon setting
  47. ; blanks equal to zero, maintained indices, formfeeds rather than linefeeds, a specific
  48. ; sort, color preferences, et cetera.
  49.  
  50.  
  51. ; However, this customization need only be done once, and can then be automatically
  52. ; incorporated for each runtime application you provide.
  53.  
  54.  
  55. ; (1)  Create a directory to hold your customized runtime version of Paradox (e. g., at
  56. ;      the DOS prompt, type MD C:\Pdox40\Runtime to create a runtime directory named
  57. ;      C:\Pdox40\Runtime).
  58.  
  59.  
  60. ; (2)  Install your runtime version of Paradox in that newly-created directory.  Unless
  61. ;      you have other needs or preferences, delete all but the following files:
  62.  
  63. ;      VERSION 4.0:        == or ==         VERSION 3.5:
  64. ;      ───────────                          ───────────
  65. ;      Dpmi16bi.ovl                         Pdoxrun.aux                        
  66. ;      Dpmiinst.exe                         Pdoxrun.exe                        
  67. ;      Dpmiload.exe                         Pdoxrun.msg                        
  68. ;      Pdoxrun.aux                          Pdoxrun.ntp                        
  69. ;      Pdoxrun.exe                          Pdoxrun.ov1                        
  70. ;      Pdoxrun.ico                          Pdoxrun.ov2                        
  71. ;      Pdoxrun.msg                          Pdoxrun.som                        
  72. ;      Pdoxrun.ov1                          Pdoxrun.sor                         
  73. ;      Pdoxrun.ov2                          Pdoxrunk.exe                        
  74. ;      Pdoxrun.pif                          Pdoxrunr.exe                        
  75. ;      Pdoxrun.som                          Pdoxrunt.exe            
  76. ;      Pdoxrun.sor                                      
  77. ;      Pdoxrun.vid                                      
  78. ;      Yomdp.dll                                        
  79.  
  80.  
  81. ;    If your runtime version will include graphs, copy all graph files (those with 
  82. ;    extension .CHR) to the runtime directory.
  83.  
  84.  
  85.      ; -- Create a "plain vanilla" version of your Paradox configuration file
  86.      ;    identical to yours except for options unique to your hardware,
  87.      ;    software, editor, and user name.
  88. ; (3)  Copy your customized configuration to a temporary file (e. g., at the DOS prompt,
  89. ;      type Copy C:\Pdox40\Paradox.cfg C:\Pdox40\Paradox.my if your Paradox files are in
  90. ;      directory C:\Pdox40).
  91.  
  92.  
  93. ;      Invoke Paradox's custom script.  (If your Paradox directory is in your path and
  94. ;      you have neither designated a working directory or established a default directory
  95. ;      in the init script, simply Paradox Custom at the DOS prompt.  Otherwise, select
  96. ;      {Scripts} {Play} from the main menu, and type in Custom, replete with its full
  97. ;      path - e. g., C:\\Pdox40\\Custom, if your main Paradox directory is named Pdox40.)
  98.  
  99.  
  100. ;      When playing the custom script, make the following changes to create a "plain
  101. ;      vanilla" version that will work on any user's machine:
  102.  
  103.  
  104. ;      ■  Select {PAL} {Editor}.
  105.  
  106. ;         Press <Ctrl+BackSpace> to clear the space.
  107.  
  108. ;         Select {Return}.
  109.  
  110.  
  111.         ; -- Change your private directory to subdirectory X of your main Paradox
  112.         ;    directory (which will automatically be created if it does not already
  113.         ;    exist).  (Private directories are strongly recommended on standalone as well
  114.         ;    as multi-user systems, and establishing one will ensure that your code will
  115.         ;    work in both environments.)
  116. ;       ■   Select {Set Private}.
  117.  
  118. ;         Type the full path of the directory containing your Paradox files, followed by
  119. ;         \X ... e. g., C:\Pdox35\X or C:\Pdox40\X.
  120.  
  121. ;         Press the <Enter> key when finished.
  122.  
  123. ;         Select {Net} {UserName}
  124.  
  125. ;         Press <Ctrl+BackSpace> to clear the space.
  126.  
  127. ;         Press the <Enter> key.
  128.  
  129. ;         Select {Return}.
  130.  
  131.  
  132. ;      ■  Select {Defaults} {Set Directory}.
  133.  
  134. ;         Press <Ctrl+BackSpace> to clear the space.
  135.  
  136. ;         Select {Return}.
  137.  
  138.  
  139. ;      ■  If designing a 3.5 application to be run on older hardware unable to accomodate
  140. ;         protected mode:
  141.  
  142. ;         Select {Tune} {Protected Mode} {Default Modes} {Real} {Return} {Return}.
  143.  
  144.  
  145. ;      ■  If your default report settings are unusual (such as elite pitch, which is not
  146. ;         available on all printers):
  147.  
  148. ;         Select {Reports} {Setup}.
  149.  
  150. ;         Move the asterisk to the printer most likely to be available to the majority of
  151. ;         your users.  (For any type of application, whether interactive or runtime, a
  152. ;         printing routine, such as the freeware generic utility that appeared in a
  153. ;         previous issue of "Instant Scripts", should also be included in your
  154. ;         application.)
  155.  
  156.  
  157. ;      ■  Press the <F2> key to execute the changes you have initiated.
  158.  
  159.  
  160.         ;  -- Copy the "plain vanilla" customized custom script to a temporary
  161.         ;     file where it will be available whenever needed.
  162. ;      ■  At the DOS prompt, type Copy C:\Pdox40\Paradox.Cfg C:\Pdox40\Paradox.Std
  163. ;         (substituting the name of the main directory containing your Paradox files if
  164. ;         other than Pdox40).
  165.  
  166.  
  167.         ;  -- Copy your own customized custom script back to Paradox's
  168.         ;     configuration file.
  169. ;      ■  At the DOS prompt, type Copy C:\Pdox40\Paradox.My C:\Pdox40\Paradox.Cfg
  170. ;         (substituting the name of the main directory containing your Paradox files if
  171. ;         other than Pdox40).
  172.  
  173.  
  174.         ;  -- Copy the "plain vanilla" customized custom script to the newly-
  175.         ;     created runtime directory
  176. ; (4)   At the DOS prompt, type Copy C:\Pdox40\Paradox.Cfg C:\Pdox40\Runtime\Paradox.Cfg
  177. ;       (substituting the name of the main directory containing your Paradox files if
  178. ;       other than Pdox40).
  179.  
  180.  
  181.         ;  -- Copy your custom files to the newly-created runtime directory:
  182. ; (5)   At the DOS prompt, type Copy C:\Pdox40\Custom.sc C:\Pdox40\Runtime\Custom.sc
  183. ;       (substituting the name of the main directory containing your Paradox files if
  184. ;       other than Pdox40).
  185.  
  186. ;       At the DOS prompt, type Copy C:\Pdox40\Custom.ov1 C:\Pdox40\Runtime\Custom.ov1
  187. ;       (substituting the name of the main directory containing your Paradox files if
  188. ;       other than Pdox40).
  189.  
  190.  
  191.         ;  -- Copy Readme.Com to the newly-created runtime directory:
  192. ; (6)   At the DOS prompt, type Copy C:\Pdox40\Readme.Com C:\Pdox40\Runtime\Readme.Com
  193. ;       (substituting the name of the main directory containing your Paradox files if
  194. ;       other than Pdox40).
  195.  
  196.  
  197.         ;  -- This utility requires that PKWare's shareware PKZip is in your path.  This
  198.         ;     can be downloaded from CompuServe or most BBSs, ordered from virtually any
  199.         ;     shareware vendor, or shared by a friend or colleague.  (Obviously, it can
  200.         ;     easily be replaced by a different archiving utility should there be one
  201.         ;     which you prefer.)
  202. ; (7)   At the DOS prompt, compress the newly customized runtime files by typing
  203. ;       Pkzip C:\Pdox40\Runtime\*.*, substituting the name of the main directory
  204. ;       containing your Paradox files if other than Pdox40.
  205.  
  206. ;       To conserve space, delete the original runtime files by typing the following
  207. ;       lines at the DOS prompt, substituting the name of the main directory containing
  208. ;       your Paradox files if other than Pdox40:
  209. ;                 Del C:\Pdox40\Runtime\PdoxRun.*
  210. ;                 Del C:\Pdox40\Runtime\Custom.*
  211. ;                 Del C:\Pdox40\Runtime\Paradox.*
  212.  
  213.  
  214.  
  215. ; ───────────────────────────────────────────────────────────────────────────────────────
  216. ;                             THE ACTUAL UTILITY BEGINS HERE
  217. ; ───────────────────────────────────────────────────────────────────────────────────────
  218.  
  219.  
  220. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  221. ; ║                           PARAMETERS  PASSED  TO  THIS  PROCEDURE                    ║
  222. ; ╟─────────────┬────────────────────────────────────────────────────┬───────────────────╢
  223. ; ║   ARGUMENT  │                   DESCRIPTION                      │      SAMPLE       ║
  224. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  225. ; ║             │                                                    │                   ║
  226. ; ║             │  1 - 8 character name/abbreviation of your         │                   ║
  227. ; ║             │  application (e. g., "Testing", to signify a       │      "Budget"     ║
  228. ; ║  SystemName │  system named Testing)                             │                   ║
  229. ; ║             │                                                    │  (To signify a    ║
  230. ; ║             │  N. B.  Unless this is a variable, it must be      │  budget system)   ║
  231. ; ║             │         enclosed in quotes.                        │                   ║
  232. ; ║             │                                                    │                   ║
  233. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  234. ; ║             │                                                    │                   ║
  235. ; ║             │                                                    │       "PTS"       ║
  236. ; ║             │  1 - 8 character name/abbreviation for your user   │                   ║
  237. ; ║             │  to type to invoke your application from DOS.      │  (for a Project   ║
  238. ; ║   Acronym   │                                                    │  Tracking System  ║
  239. ; ║             │  N. B.  Unless this is a variable, it must be      │  invoked by typ-  ║
  240. ; ║             │         enclosed in quotes.                        │  ing PTS at the   ║
  241. ; ║             │                                                    │  DOS prompt)      ║
  242. ; ║             │                                                    │                   ║
  243. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  244. ; ║             │                                                    │                   ║
  245. ; ║             │  Password (if applicable) in order to copy         │                   ║
  246. ; ║             │  protected tables and scripts to the diskette.     │                   ║
  247. ; ║             │                                                    │                   ║
  248. ; ║             │  (If this is invoked from your main script -       │                   ║
  249. ; ║             │  and that it protected - the password will         │     "AGORA"       ║                                    ║
  250. ; ║   UserPass  │  remain hidden.)                                   │                   ║                                    ║
  251. ; ║             │                                                    │  (To signify      ║
  252. ; ║             │  N. B.  Remember that passwords are case           │  password AGORA)  ║
  253. ; ║             │         sensitive.                                 │                   ║
  254. ; ║             │                                                    │                   ║
  255. ; ║             │         Unless this is a variable, it must be      │                   ║
  256. ; ║             │         enclosed in quotes.                        │                   ║
  257. ; ║             │                                                    │                   ║
  258. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  259. ; ║             │                                                    │                   ║
  260. ; ║             │  The name of the main (or "driver") Paradox        │                   ║
  261. ; ║             │  script that will invoke the system on you user's  │     "Budget"      ║
  262. ; ║   Driver    │  user's PC.                                        │                   ║
  263. ; ║             │                                                    │  (To signify a    ║
  264. ; ║             │  N. B.  Unless this is a variable, it must be      │  main script      ║
  265. ; ║             │         enclosed in quotes.                        │  named Budget)    ║
  266. ; ║             │                                                    │                   ║
  267. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  268. ; ║             │                                                    │                   ║
  269. ; ║             │  The files (other than tables) to be included on   │                   ║
  270. ; ║             │  the runtime diskette                              │                   ║
  271. ; ║             │                                                    │                   ║
  272. ; ║             │  Enter "ALL" if the entire system (including all   │      "ALL"        ║
  273. ; ║             │  subdirectories) is to be included in the runtime  │                   ║
  274. ; ║             │  version.                                          │  (to copy all     ║
  275. ; ║             │                                                    │  files in the     ║
  276. ; ║             │  If the runtime version is to include only a       │  specified        ║
  277. ; ║             │  subset of the data and/or files, cite each        │  directory)       ║
  278. ; ║             │  individual file name, encased in curly brackets   │                   ║
  279. ; ║             │  ({}) with NO space between the brackets.          │                   ║
  280. ; ║             │                                                    │                   ║
  281. ; ║  WhichFiles │  For example, you might design a major system      │                   ║
  282. ; ║             │  wherein each employee updates his information     │  "{Manager.Sc}    ║
  283. ; ║             │  and transfers it back and forth via diskette.     │   {Budget.Sc}     ║
  284. ; ║             │  Obviously, providing him with all of the          │   {Guide.Doc}"    ║
  285. ; ║             │  company's data would both prove unwieldy and      │                   ║
  286. ; ║             │  jeopardize security.  Likewise, many major        │  (if only these   ║
  287. ; ║             │  systems have numerous components.  One            │  three files are  ║
  288. ; ║             │  subdirectory may encompass project management,    │  to be included)  ║
  289. ; ║             │  another budgets, etc.  Each department need (and  │                   ║
  290. ; ║             │  should) only receive the files relating to them.  │                   ║
  291. ; ║             │                                                    │                   ║
  292. ; ║             │  N. B.  This must be enclosed in quotes.           │                   ║
  293. ; ║             │                                                    │                   ║
  294. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  295. ; ║             │                                                    │                   ║
  296. ; ║             │                                                    │       ""          ║
  297. ; ║             │  If you have opted to copy all files, simply       │ (if you opted to  ║
  298. ; ║             │   assign "" to this variable.                      │ copy all files)   ║
  299. ; ║             │                                                    │                   ║
  300. ; ║  WhichTbls  │  Otherwise, list all of the tables needed for      │ "{Items}          ║
  301. ; ║             │  runtime version, each encased in curly brackets   │  {Data\\Orders}"  ║
  302. ; ║             │  and with no space between the brackets            │                   ║
  303. ; ║             │                                                    │ (to copy tables   ║
  304. ; ║             │  N. B.  This must be enclosed in quotes.           │ named Items and   ║
  305. ; ║             │                                                    │ Data\\Orders)     ║
  306. ; ║             │                                                    │                   ║
  307. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  308. ; ║             │                                                    │                   ║
  309. ; ║             │                                                    │    "ProjMgmt"     ║
  310. ; ║             │  The name of the directory to be created to        │                   ║
  311. ; ║             │  contain the system on the user's PC               │ (To create a      ║
  312. ; ║  TargetDir  │                                                    │ directory named   ║
  313. ; ║             │                                                    │ ProjMgmt for a    ║
  314. ; ║             │  N. B.  This must be enclosed in quotes.           │ project manage-   ║
  315. ; ║             │                                                    │ ment system)      ║
  316. ; ║             │                                                    │                   ║
  317. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  318. ; ║             │                                                    │                   ║
  319. ; ║             │                                                    │   "C:\\Pdox40"    ║
  320. ; ║             │  The name (including full path) of the directory   │                   ║
  321. ; ║             │  containing your main Paradox system files         │  (To signify      ║
  322. ; ║ MainPdoxDir │                                                    │  that your main   ║
  323. ; ║             │                                                    │  Paradox system   ║
  324. ; ║             │  N. B.  This must be enclosed in quotes.           │  files are con-   ║
  325. ; ║             │                                                    │  tained in        ║
  326. ; ║             │                                                    │  directory        ║
  327. ; ║             │                                                    │  "C:\\Pdox40")    ║
  328. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  329. ; ║             │                                                    │                   ║
  330. ; ║             │  Name of directory containing your runtime files - │                   ║
  331. ; ║             │                                                    │                   ║
  332. ; ║             │  (This is invoked as an argument to prevent having │                   ║
  333. ; ║             │  to waste disk space by keeping a copies in each   │                   ║
  334. ; ║             │  applications' subdirectories.)                    │    "C:\\Pdox40    ║
  335. ; ║             │                                                    │    \\Runtime"     ║
  336. ; ║             │  This utility requires a runtime version of        │                   ║
  337. ; ║             │  Paradox that has been configured to match your    │                   ║
  338. ; ║             │  coding constraints - e.  g., whether or not your  │                   ║
  339. ; ║             │  code is dependent upon setting blanks equal to    │    (to signify    ║
  340. ; ║             │  zero, maintained indices, formfeeds rather than   │    that your      ║
  341. ; ║  RuntimeDir │  linefeeds, a specific sort, color preferences, et │    Runtime.Zip    ║
  342. ; ║             │  cetera.                                           │    file is in     ║                ║
  343. ; ║             │                                                    │    your main      ║                ║
  344. ; ║             │  If this has not already been done, please reread  │    Paradox        ║                ║
  345. ; ║             │  the "Important Notes" at the beginning of this    │    directory's    ║                ║
  346. ; ║             │  utility and follow the step-by-step instructions. │    subdirectory   ║
  347. ; ║             │  (This will only have to be done once, since your  │    named runtime) ║
  348. ; ║             │  customized runtime file can be used over and over │                   ║
  349. ; ║             │  again to create runtime versions of all of your   │                   ║
  350. ; ║             │  applications.)                                    │                   ║
  351. ; ║             │                                                    │                   ║
  352. ; ║             │  N. B.  This must be enclosed in quotes.           │                   ║
  353. ; ║             │                                                    │                   ║
  354. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  355. ; ║             │                                                    │                   ║
  356. ; ║             │  The type of PC being used ("AT", "XT", "386", or  │                   ║
  357. ; ║             │  "Laptop")                                         │                   ║
  358. ; ║             │                                                    │                   ║
  359. ; ║             │  Unfortunately, many clones fail to specify class -│       "AT"        ║
  360. ; ║             │  and most beginners have no idea what they are     │                   ║
  361. ; ║    PCType   │  using.  When in doubt, it is therefore prudent to │                   ║
  362. ; ║             │  have applications default to "XT", since double   │    (to specify    ║
  363. ; ║             │  density diskettes can also be used by ATs.        │    an AT)         ║
  364. ; ║             │                                                    │                   ║
  365. ; ║             │  N. B.  Unless this is a variable, it must be      │                   ║
  366. ; ║             │         enclosed in quotes.                        │                   ║
  367. ; ║             │                                                    │                   ║
  368. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  369. ; ║             │                                                    │                   ║
  370. ; ║             │                                                    │       "A"         ║
  371. ; ║             │  The floppy drive in which the diskette is to be   │                   ║
  372. ; ║             │  to copy the runtime system                        │  (To signify      ║
  373. ; ║             │                                                    │  Drive A)         ║
  374. ; ║   WhereTo   │  (Use "" to have the user prompted to designate    │                   ║
  375. ; ║             │  the drive.)                                       │       ""          ║
  376. ; ║             │                                                    │  (To have the     ║
  377. ; ║             │  N. B.  Unless this is a variable, it must be      │  user prompted    ║
  378. ; ║             │         enclosed in quotes.                        │  to designate     ║
  379. ; ║             │                                                    │  the drive)       ║
  380. ; ║             │                                                    │                   ║
  381. ; ╟─────────────┼────────────────────────────────────────────────────┼───────────────────╢
  382. ; ║             │                                                    │                   ║
  383. ; ║             │  When uploading files to bulletin boards or        │                   ║
  384. ; ║             │  CompuServe, it is awkward (if not impossible) to  │                   ║
  385. ; ║             │  incorporate separate installation batch files.    │                   ║
  386. ; ║             │  Accompanying instructional text files are         │       "Yes"       ║
  387. ; ║             │  equally impractical, since they can easily        │                   ║
  388. ; ║             │  become separated from the original.               │   (if this        ║
  389. ; ║             │                                                    │   SingleExeFile   ║
  390. ; ║             │  Although licensing restrictions preclude          │   will be needed) ║
  391. ; ║             │  randomly circulating runtime versions, many       │                   ║
  392. ; ║             │  people have created shareware products clearly    │                   ║
  393. ; ║             │  stipulating the proper licensing arrangement.     │                   ║
  394. ; ║             │  Likewise, many companies transfer such files      │                   ║
  395. ; ║             │  back and forth via modem.                         │                   ║
  396. ; ║SingleExeFile│                                                    │       - or -      ║
  397. ; ║             │  Accordingly, whenever a single file is            │                   ║
  398. ; ║             │  preferable (as when preparing a runtime version   │                   ║
  399. ; ║             │  to be sent via modem, the system will             │                   ║
  400. ; ║             │  automatically create a special executable file    │                   ║
  401. ; ║             │  combining the system and batch file into one      │       "No"        ║
  402. ; ║             │  file.  Once the user has typed the name of the    │                   ║
  403. ; ║             │  exe file, it will explode into another            │   (if this        ║
  404. ; ║             │  installation file, an install.bat file, and a     │   SingleExeFile   ║
  405. ; ║             │  read.me file, proving very intuitive to the       │   will not be     ║
  406. ; ║             │  user.                                             │   needed)         ║
  407. ; ║             │                                                    │                   ║
  408. ; ║             │  Select "Yes" if this SingleExeFile will be        │                   ║
  409. ; ║             │  necessary, or "No" if it is not required.         │                   ║
  410. ; ║             │                                                    │                   ║
  411. ; ╚═════════════╧════════════════════════════════════════════════════╧═══════════════════╝
  412.  
  413.  
  414. Proc Make_Runtime(SystemName, Acronym,     UserPass,   Driver,  WhichFiles,  WhichTbls,
  415.                   TargetDir,  MainPdoxDir, RuntimeDir, PCType,  WhereTo,     SingleExeFile)
  416.    Private FlName, RDADir, Tbl, Tmp
  417.  
  418.    ; --- Check to see if the user left a temporary runtime directory from a
  419.    ;     previous session (e. g., illegally aborted or changed options to
  420.    ;     save the files)
  421.    If DirExists("MakeRun") = 1
  422.       Then Cursor Off
  423.            Clear_Canvas()
  424.            Draw_Box("Wide", 63, 00, 00, 24, 79, "", "")  ; White on cyan
  425.            Draw_Box("Wide", 15, 05, 07, 16, 73, "", "")  ; White on black
  426.            Style Attribute 11                            ; light cyan on black
  427.            @ 07,12 ?? "You already have a directory/file created during a"
  428.            @ 08,12 ?? "previous session, which you chose not to delete from"
  429.            @ 09,12 ?? "within the program (as is set up to occur automatically)."
  430.            @ 11,12 ?? "Please review the files in temporary directory MakeRun."
  431.            @ 13,12 ?? "When ready to run this system, delete those files and"
  432.            @ 14,12 ?? "remove the MakeRun directory."
  433.            Style attribute 03
  434.            @ 21,22 ?? " Press any key when ready to proceed. "
  435.            Dummy = Getchar()
  436.            Cursor Normal
  437.            Return
  438.    Endif
  439.  
  440.    ; Give the password necessary to copy the tables and scripts
  441.    If Isassigned(UserPass) and Not IsBlank(UserPass)
  442.       Then Password UserPass
  443.    EndIf
  444.  
  445.    WhichDir      = Directory()
  446.    SingleExeFile = Upper(SingleExeFile)
  447.    SetDir Directory() ; clear temporary Tables
  448.  
  449.    ; -- Create temporary directory to create runtime version
  450.    Run "MD MakeRun"
  451.  
  452.    If Not IsAssigned(AutoLib) or IsBlank(AutoLib)
  453.       Then LibName = "TempRun"
  454.          CreateLib LibName
  455.          WriteLib LibName Create_InstallationFile   Release Procs Create_InstallationFile
  456.          WriteLib LibName Which_Files               Release Procs Which_Files
  457.          WriteLib LibName Make_Floppy               Release Procs Make_Floppy
  458.          WriteLib LibName Make_Label                Release Procs Make_Label
  459.          WriteLib LibName Copy_More                 Release Procs Copy_More
  460.          WriteLib LibName Single_ExeFile            Release Procs Single_ExeFile
  461.          WriteLib LibName Clear_Canvas              Release Procs Clear_Canvas
  462.          WriteLib LibName Draw_Box                  Release Procs Draw_Box
  463.          WriteLib LibName Cross_Line                Release Procs Cross_Line
  464.          WriteLib LibName Please_Wait               Release Procs Please_Wait
  465.          WriteLib LibName Backup_Data               Release Procs Backup_Data
  466.          WriteLib LibName Check_TargetDrive         Release Procs Check_TargetDrive
  467.          AutoLib = (Directory()) + "TempRun"
  468.    EndIf
  469.  
  470.    ; -- Copy customized version of Paradox's runtime files to this directory
  471.    Run "Copy " + RuntimeDir + "\\Runtime.Zip MakeRun\\Runtime.Zip"
  472.  
  473.    ; -- Unarchive runtime.zip (requires that utility PkZip is in path)
  474.    {Tools} {More} {Directory} Typein "MakeRun\\" Enter {OK}
  475.    Run "PkUnzip -d Runtime.Zip"
  476.  
  477.    {Tools} {More} {Directory} Select WhichDir {OK}
  478.  
  479.    ; -- Create a file named backup.txt to ensure a complete user-friendly, menu-driven
  480.    ;    application by bypassing DOS questions when the diskette is being formatted.
  481.    If not IsFile("Backup.Txt")
  482.       Then Print File "Backup.Txt" "N",   "\N"
  483.            Print File "Backup.Txt" "/26", "\N"
  484.    EndIf
  485.  
  486.    ; -- Delete original Runtime.Zip from temporary directory
  487.    Run "Del MakeRun\\Runtime.Zip: <Backup.Txt >Nul"
  488.  
  489.    Run "Copy Backup.Txt MakeRun\\Backup.Txt"
  490.  
  491.    ; -- create Acronym batch file
  492.    Print File "MakeRun\\" + Acronym + ".Bat" "CD\\"     + TargetDir, "\N"
  493.    Print File "MakeRun\\" + Acronym + ".Bat" "PdoxRun " + Driver,    "\N"
  494.  
  495.    Which_Files()
  496.  
  497.    ; -- If you have not already done so, for all scripts in subdirectory MakeRun, change
  498.    ;    every occurrence of Echo to TKEcho.  (As explained at the beginning ot this
  499.    ;    article, since TKEcho will work in both runtime and interactive Paradox, most
  500.    ;    developers simply use TKEcho in all code to ensure that all applications are
  501.    ;    "version independent" and will work in either runtime or interactive Paradox.)
  502.  
  503.  
  504.    ; -- Make the archived files a self-extracting archive file so that they can be
  505.    ;    unarchived by the user regardless of whether or not he owns PkZip.
  506.    ;    (requires that utility PkZip is in path)
  507.    Run "Zip2Exe " + SystemName
  508.  
  509.    ; -- Note variation below for handling files that exceed the size of your
  510.    ;    diskette.
  511.  
  512.    ; -- Delete now unnecessary zipped file
  513.    Run "Del " + SystemName + ".Zip"
  514.  
  515.    ; -- Create files needed to automatically install and invoke the system
  516.    ;    (If not using a single exe file, copy to diskettes and make
  517.    ;    appropriate labels.)
  518.    Switch
  519.       Case SingleExeFile = "NO" : Create_InstallationFile(SystemName)
  520.                                   Make_Floppy()
  521.                                   Copy_More()
  522.       Case SingleExeFile = "YES": Create_InstallationFile("ZipFiles")
  523.                                   Single_ExeFIle()
  524.    EndSwitch
  525.  
  526.    ; -- Delete the temporary directory.  (Uncomment these lines should you
  527.    ;    prefer to keep the entire runtime system in a subdirectory.)
  528.  
  529.    ; -- If RDA is supported, delete the subdirectories
  530.    Array Tbl[100]
  531.    For X From 1 To 100
  532.       If Match(WhichTbls, "{..}..", ThisTbl, WhichTbls)
  533.          Then Tbl[X] = ThisTbl
  534.             If Match(ThisTbl, "..\\..", RDADir, Tmp)
  535.                Then If DirExists(RDADir) <> 1
  536.                        Then Run "RD "  + RDADir
  537.                     EndIf
  538.             EndIf
  539.          Else QuitLoop
  540.       EndIf
  541.    EndFor
  542.    If SingleExeFile  = "NO"
  543.       Then {Tools} {More} {Directory} Select WhichDir {OK}
  544.            Run "Del MakeRun\\*.Exe"
  545.            Run "Del MakeRun\\*.Bat"
  546.            "RD MakeRun"
  547.    EndIf
  548.  
  549.    ; Remove the password to keep the tables and scripts protected
  550.    If Isassigned(UserPass) and Not IsBlank(UserPass)
  551.       Then UnPassword UserPass
  552.    EndIf
  553.  
  554. EndProc
  555.  
  556. Proc Create_InstallationFile(ExeNum) ; ExeNum = the number of exe files required
  557.    Private L
  558.    ; -- Create installation batch file
  559.    Array L[28]
  560.          L[1]  = "@ Echo off"
  561.          L[2]  = "CLS"
  562.          L[3]  = "Echo."
  563.          L[4]  = "Echo."
  564.          L[5]  = "Echo."
  565.          L[6]  = "Echo           █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█"
  566.          L[7]  = "Echo           █                                                        █"
  567.          L[8]  = "Echo           █     Please wait while your files are being set up.     █"
  568.          L[9]  = "Echo           █                                                        █"
  569.          L[10] = "Echo           █     In the future, to run the program:                 █"
  570.          L[11] = "Echo           █                                                        █"
  571.          L[12] = "Echo           █     (1)  Go to the DOS prompt.                         █"
  572.          L[13] = "Echo           █                                                        █"
  573.          L[14] = "Echo           █     (2)  Type " + Acronym + " to run your application."
  574.                  + Spaces(16 - Len(Acronym)) + "█"
  575.          L[15] = "Echo           █                                                        █"
  576.          L[16] = "Echo           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"
  577.          L[17] = "Echo."
  578.          L[18] = "Echo."
  579.          L[19] = "Echo."
  580.          L[20] = "MD " + MainPdoxDir + "\\X"
  581.          L[21] = "CD\\"
  582.          L[22] = "MD "         + TargetDir
  583.          L[23] = "CD \\"       + TargetDir
  584.          L[24] = WhereTo + ":" + ExeNum + " -D"
  585.          L[25] = "CLS"
  586.          L[26] = "CD\\"
  587.          L[27] = "Copy "       + TargetDir + "\\" + Acronym + ".bat " + Acronym + ".Bat"
  588.          L[28] = Acronym
  589.          For N from 1 to ArraySize(L)
  590.             Print File "Install.Bat" L[N], "\N"
  591.          Endfor
  592. EndProc
  593.  
  594. Proc Which_Files()  ; If not copying all files, provide list of tables in directory
  595.                      ; if all, use XCopy.  Otherwise,
  596.                      ; run as shown
  597.    WhichFiles = Upper(WhichFiles)
  598.    If WhichFiles <> "ALL"
  599.       Then ; -- Copy all necessary tables to temporary directory
  600.            ;    (Use Paradox rather than DOS copy for tables to include family objects)
  601.            ; If RDA is supported, create the necessary directories
  602.            Array Tbl[100]
  603.            For X From 1 To 100
  604.               If Match(WhichTbls, "{..}..", ThisTbl, WhichTbls)
  605.                  Then Tbl[X] = ThisTbl
  606.                     If Match(ThisTbl, "..\\..", RDADir, Tmp)
  607.                        Then If DirExists("MakeRun\\" + RDADir) <> 1
  608.                                Then Run "MD " + "MakeRun\\" + RDADir
  609.                             EndIf
  610.                     Endif
  611.                     Copy ThisTbl "MakeRun\\" + ThisTbl
  612.                     If MenuChoice() = "Cancel"
  613.                        Then Select "Replace"
  614.                     EndIf
  615.                  Else QuitLoop
  616.               EndIf
  617.            EndFor
  618.            ; -- Copy all necessary files (other than tables) to temporary directory
  619.            Array FlName[100]
  620.            For X From 1 To 100
  621.               If Match(WhichFiles, "{..}..", ThisFile, WhichFiles)
  622.                  Then FlName[X] = ThisFile
  623.                       If Match(ThisFile, "..\\..", RDADir, Tmp)
  624.                          Then If DirExists("MakeRun\\" + RDADir) <> 1
  625.                                  Then Run "MD MakeRun\\" + RDADir
  626.                               EndIf
  627.                       EndIf
  628.                       Run "Copy " + ThisFile + " MakeRun\\" + ThisFile
  629.                  Else QuitLoop
  630.               EndIf
  631.            EndFor
  632.            ; -- Archive all files needed for runtime version (requires that utility PkZip is in
  633.            ;    path)
  634.            {Tools} {More} {Directory} Typein "MakeRun\\" Enter {OK}
  635.            Run "Pkzip -rpm " + SystemName
  636.       Else Run "Copy MakeRun\\*.*"
  637.            Run "Del MakeRun\\*.*"
  638.            Run "Pkzip -rp " + SystemName
  639.            Run "Ren " + SystemName + ".Zip MakeRun\\" + SystemName + ".Zip"
  640.            Run "Del PdoxRun.*"
  641.            Run "Del Custom.*"
  642.            Run "Del *.Cfg"
  643.            {Tools} {More} {Directory} Typein "MakeRun\\" Enter {OK}
  644.    EndIf
  645. EndProc
  646.  
  647. Proc Make_Floppy()
  648.    If IsBlank(WhereTo)
  649.       Then Clear_Canvas()
  650.            Draw_Box("Wide", 63, 04, 04, 18, 76, "", "")
  651.            Style Attribute 03 @ 15,12 ?? " Press the <Enter> key when finished, or <Esc> to quit. "
  652.            Style Attribute 48 @ 07,23 ?? "Which drive will you place the diskette in?"
  653.            Style Attribute 63 @ 11,25 ?? "Please answer either A or B:  "
  654.            Style attribute 11 Accept "A1" Required Picture "A,B" To WhereTo
  655.    EndIf
  656.    PcType  = Upper(PCType)
  657.    Switch
  658.       Case PCType = "AT"
  659.         or PCType = "386"    : Density  = "high"
  660.                                Switch
  661.                                   Case WhereTo = "A": Disksize = "5 1/4"
  662.                                   Case WhereTo = "B": Disksize = "3 1/2"
  663.                                EndSwitch
  664.       Case PCType = "XT"     : Disksize = "5 1/4"
  665.                                Density  = "double"
  666.       Case PCType = "LAPTOP" : Disksize = "3 1/2"
  667.                                Density  = "double"
  668.    Endswitch
  669.    Clear_Canvas()
  670.    Draw_Box("Wide", 63, 00, 03, 24, 76, "", "")               ; White on cyan
  671.    @ 18,21 ?? "Does this diskette need to be formatted?"
  672.    Style attribute 48                                         ; Black on cyan
  673.    @  7,10 ?? "You will need a formatted "+DiskSize+"-inch double-sided, "+Density+"-"
  674.    @  8,10 ?? "density diskette (floppy disk)."
  675.    @ 10,10 ?? "Holding the diskette at the top (so that the manufacturer's"
  676.    @ 11,10 ?? "label is to the right, and the write-protect notch is to the"
  677.    @ 12,10 ?? "left), place it in your computer's floppy drive "+ Upper(WhereTo) +"."
  678.    @ 14,10 ?? "Pull down the lever at the top of the floppy drive.  (If"
  679.    @ 15,10 ?? "there is no lever, make certain that the diskette is firmly"
  680.    @ 16,10 ?? "in place.)"
  681.    Draw_Box("Wide", 15, 02, 13, 04, 65, "", "")  ; White on black
  682.    Style Attribute 11                            ; light cyan on black
  683.    Header = "MAKING ALLOCATION DISKETTE"
  684.    @ 3,16 ??  Format("AC,CU,W48",Strval(Header))
  685.    Style attribute 03
  686.    @ 22,14 ?? "Press the <Enter> key when finished (or <Esc> to quit)."
  687.    Style Attribute 15                            ; white on black
  688.    @ 20,26 ?? "Please answer Yes or No:   "      ; relates to the above question
  689.    Style Attribute 11 Accept "A3" Required picture "{YES,NO}" to YN
  690.    If retval = False                             ; Return if user pressed escape key
  691.       Then return
  692.       Else Check_TargetDrive()
  693.            If YN = "YES"
  694.               Then Please_Wait("Please wait while the diskette is being formatted.")
  695.                    Run NoRefresh "Format " + WhereTo + ": <Backup.Txt >Nul"
  696.               Else Run "Del " + WhereTo + ":\\*.*: <Backup.Txt >Nul"
  697.            Endif
  698.            Please_Wait("Please wait until light goes out and you hear a beep")
  699.            ; Copy designated files to diskette
  700.            Run Big NoRefresh "Copy " + SystemName + "*.Exe " + WhereTo + ":"
  701.            If IsFile("Install.Bat")
  702.               Then Run Big NoRefresh "Copy Install.Bat " + WhereTo + ":"
  703.            EndIf
  704.    Endif
  705.    Beep                     ; Beep to advise user that backup is finished
  706.    Make_Label()
  707. EndProc
  708.  
  709. Proc Make_Label()
  710.    Cursor Off
  711.    Clear_Canvas()
  712.    Draw_Box("Wide", 63, 00, 00, 24, 79, "", "")               ; White on cyan
  713.    Style attribute 48                                         ; Black on cyan
  714.    @ 03,03 ?? "Make a label to tell the user how to install and invoke the system - e. g.,"
  715.    Draw_Box("Wide", 15, 07, 15, 17, 64, "", "")  ; White on black
  716.    Style Attribute 11                            ; light cyan on black
  717.    @ 09,17 ??  Format("AC,CU,W43",(Strval(SystemName) + " SYSTEM"))
  718.    @ 11,21 ?? "To install the system, insert this"
  719.    @ 12,21 ?? "diskette in drive " + WhereTo + " and type " + WhereTo + ":Install."
  720.    @ 14,21 ?? "To invoke the system in the future,"
  721.    @ 15,21 ?? "type " + Acronym + " at any DOS prompt."
  722.    Style attribute 03
  723.    @ 21,22 ?? " Press any key when ready to proceed. "
  724.    Dummy = Getchar()
  725.    Cursor Normal
  726. EndProc
  727.  
  728. Proc Copy_More()
  729.    While True
  730.       Clear_Canvas()
  731.       Draw_Box("Wide", 63, 06, 06, 19, 72, "", "")               ; White on cyan
  732.       Style attribute 48                                         ; Black on cyan
  733.       @ 09,19 ?? "Do you want to copy the runtime files "
  734.       @ 10,19 ?? "to any other diskette(s) at this time?"
  735.       Style attribute 03
  736.       @ 16,12 ?? "Press the <Enter> key when finished (or <Esc> to quit)."
  737.       Style Attribute 15                            ; white on black
  738.       @ 13,24 ?? "Please answer Yes or No:   "      ; relates to the above question
  739.       Style Attribute 11 Accept "A3" Required picture "{YES,NO}" to YN
  740.       If retval = False                             ; Return if user pressed escape key
  741.          Then return
  742.          Else If YN = "YES"
  743.                Then Make_Floppy()
  744.                Else QuitLoop
  745.             Endif
  746.             Please_Wait("Please wait until light goes out and you hear a beep")
  747.             Beep       ; Beep to advise user that backup is finished
  748.       EndIf
  749.    EndWhile
  750. EndProc
  751.  
  752. Proc Single_ExeFile()
  753.   Private WhichName
  754.   ; -- Delete all unnecessary files
  755.   Run "Ren " + SystemName + ".Exe ZipFiles.Exe"
  756.   ; -- Create readme file for user
  757.   Array L[23]
  758.         L[1]  = "@ Echo off"
  759.         L[2]  = "CLS"
  760.         L[3]  = "Echo."
  761.         L[4]  = "Echo."
  762.         L[5]  = "Echo."
  763.         L[6]  = "Echo."
  764.         L[7]  = "Echo."
  765.         L[8]  = "Echo           █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█"
  766.         L[9]  = "Echo           █                                                        █"
  767.         L[10] = "Echo           █   Please type the word INSTALL to install the system.  █"
  768.         L[11] = "Echo           █                                                        █"
  769.         L[12] = "Echo           █     In the future, to run the program:                 █"
  770.         L[13] = "Echo           █                                                        █"
  771.         L[14] = "Echo           █     (1)  Go to the DOS prompt.                         █"
  772.         L[15] = "Echo           █                                                        █"
  773.         L[16] = "Echo           █     (2)  Type " + Acronym + " to run your application."
  774.                 + Spaces(16 - Len(Acronym)) + "█"
  775.         L[17] = "Echo           █                                                        █"
  776.         L[18] = "Echo           ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀"
  777.         L[19] = "Echo."
  778.         L[20] = "Echo."
  779.         L[21] = "Echo."
  780.         L[22] = "Echo."
  781.         L[23] = "Echo."
  782.         For N from 1 to ArraySize(L)
  783.            Print File "Read.Bat" L[N], "\N"
  784.         Endfor
  785.         Run "PkZip -RPM " + SystemName
  786.         Run "Zip2Exe "    + SystemName
  787.         Run "Del *.Bat"
  788.         Run "Del *.Zip"
  789.         ; -- If you want to keep both versions - one for modem transfers and
  790.         ;    another for diskettes - simply uncomment the next two lines:
  791. EndProc
  792.  
  793. ; ───────────────────────────────────────────────────────────────────────────────────────
  794. ; The following generic utilities are separate procedures called by Make_Runtime (i. e.,
  795. ; they can be used by themselves in any application, and were described at length in past
  796. ; issues of "Instant Scripts").
  797.  
  798. ; Although they can be dramatically simplified (and enhanced) in 4.0, they are used in
  799. ; this manner to ensure that the utility will work with either version of Paradox.
  800. ; ───────────────────────────────────────────────────────────────────────────────────────
  801.  
  802. Proc Clear_Canvas()  ; set canvas to black background
  803.    Clear Clearall
  804.    Paintcanvas Attribute 00 00, 00, 24, 79 Style attribute 15 ; black
  805. Endproc
  806.  
  807. Proc Draw_Box(LineType,BoxColor,StartRow,StartColumn,Endrow,EndColumn,FirstCross,NextCross)
  808.    Private FillNum,     ; Number of horizontal characters to fill in
  809.            X            ; A counter
  810.    Fillnum = (EndColumn - StartColumn -1)
  811.    Linetype = Upper(LineType)
  812.    Switch
  813.       Case LineType = "SINGLE": UpperLeft     = "\218"   UpperRight       = "\191"
  814.                                 LeftCross     = "\195"   RightCross       = "\180"
  815.                                 LowerLeft     = "\192"   LowerRight       = "\217"
  816.                                 HorizontalTop = "\196"   HorizontalBottom = "\196"
  817.                                 Vertical      = "\179"
  818.       Case LineType = "DOUBLE": UpperLeft     = "\201"   UpperRight       = "\187"
  819.                                 LeftCross     = "\204"   RightCross       = "\185"
  820.                                 LowerLeft     = "\200"   LowerRight       = "\188"
  821.                                 HorizontalTop = "\205"   HorizontalBottom = "\205"
  822.                                 Vertical      = "\186"
  823.       Case LineType = "WIDE":   UpperLeft     = "\219"   UpperRight       = "\219"
  824.                                 LeftCross     = "\219"   RightCross       = "\219"
  825.                                 LowerLeft     = "\219"   LowerRight       = "\219"
  826.                                 HorizontalTop = "\223"   HorizontalBottom = "\220"
  827.                                 Vertical      = "\219"
  828.    EndSwitch
  829.    PaintCanvas Attribute BoxColor StartRow, StartColumn, EndRow, EndColumn  Style Attribute BoxColor
  830.    @ StartRow, StartColumn ?? UpperLeft, Fill(HorizontalTop,FillNum), UpperRight
  831.    For X From (StartRow + 1) to (EndRow - 1)
  832.       @ X,StartColumn ?? Vertical             ; Vertical lines at the "starting" column
  833.       @ X,EndColumn   ?? Vertical             ; Vertical lines at the "ending" column
  834.    EndFor
  835.    If not isblank(FirstCross)
  836.       Then @ FirstCross, StartColumn ?? LeftCross, Fill(HorizontalTop,FillNum), RightCross
  837.            If not isblank(NextCross)
  838.               Then @ NextCross,  StartColumn ?? LeftCross, Fill(HorizontalTop,FillNum), RightCross
  839.            Endif
  840.    Endif
  841.    @ EndRow, StartColumn ?? LowerLeft, Fill(HorizontalBottom,FillNum), LowerRight
  842. Endproc
  843.  
  844. Proc Cross_Line(LineType,StartRow,StartColumn,EndColumn)
  845.    Private FillNum,       ; Number of characters to fill in
  846.            X,             ; A counter
  847.            DOUBLESINGLE   ; Single line drawn across double-lined box
  848.    Fillnum = (EndColumn - StartColumn -1)
  849.    Switch
  850.       Case LineType = "SINGLE"       : LeftCross       = "\195"   ; ├
  851.                                        HorizontalCross = "\196"   ; ─
  852.                                        RightCross      = "\180"   ; ┤
  853.       Case LineType = "DOUBLE"       : LeftCross       = "\204"   ; ╠
  854.                                        HorizontalCross = "\205"   ; ═
  855.                                        RightCross      = "\185"   ; ╣
  856.       Case LineType = "WIDE"         : LeftCross       = "\219"   ; █
  857.                                        HorizontalCross = "\223"   ; ▀
  858.                                        RightCross      = "\219"   ; █
  859.       Case LineType = "DOUBLESINGLE" : LeftCross       = "\218"   ; ╟
  860.                                        HorizontalCross = "\196"   ; ─
  861.                                        RightCross      = "\191"   ; ╢
  862.    EndSwitch
  863. Endproc
  864.  
  865. Proc Please_Wait(WaitMssg)
  866.    Cursor Off                                        ; Do not show cursor
  867.    Clear Clearall                                    ; Clear screen and canvas
  868.    PaintCanvas Attribute 00  00, 00, 24, 79          ; Draw black background
  869.    PaintCanvas Attribute 112 10, 07, 14, 75          ; Draw grey shadow
  870.    PaintCanvas Attribute 48  09, 04, 13, 73          ; Draw cyan box
  871.    Style Attribute 176                               ; Draw blinking black characters
  872.    @ 11,05 ??  " \07 \07 \07 "                       ; (Ascii code 7)
  873.    @ 11,66 ??  " \07 \07 \07 "                       ; (Ascii code 7)
  874.    Style Attribute 48                                ; Show black lettering
  875.    @ 11,13 ?? Format("AC,CC,W52",Strval(Waitmssg))   ; Center message (capitalizing
  876. Endproc                                              ; first letter of each word)
  877.  
  878. Proc Backup_Data(SystemName,WhichFiles,WhichDir,PCType,WhereTo)  ; back up data
  879.    Private Density,       ; Density of diskette (determined by argument PCType)
  880.            Header,        ; Heading (determined by argument SystemName)
  881.            YN             ; Whether or not user wants diskette formatted
  882.    If IsBlank(WhereTo)
  883.       Then Clear_Canvas()
  884.            Draw_Box("Wide", 63, 04, 04, 18, 76, "", "")
  885.            Style Attribute 03 @ 15,12 ?? " Press the <Enter> key when finished, or <Esc> to quit. "
  886.            Style Attribute 48 @ 07,23 ?? "Which drive will you place the diskette in?"
  887.            Style Attribute 63 @ 11,25 ?? "Please answer either A or B:  "
  888.            Style attribute 11 Accept "A1" Required Picture "A,B" To Whereto
  889.    EndIf
  890.    PcType = Upper(PCType)
  891.    Switch
  892.       Case PCType = "AT"
  893.         or PCType = "386"    : Density  = "high"
  894.                                Switch
  895.                                   Case WhereTo = "A": Disksize = "5 1/4"
  896.                                   Case WhereTo = "B": Disksize = "3 1/2"
  897.                                EndSwitch
  898.       Case PCType = "XT"     : Disksize = "5 1/4"
  899.                                Density  = "double"
  900.       Case PCType = "LAPTOP" : Disksize = "3 1/2"
  901.                                Density  = "double"
  902.    Endswitch
  903.    Clear_Canvas()
  904.    Draw_Box("Wide", 63, 00, 03, 24, 76, "", "")               ; White on cyan
  905.    @ 18,21 ?? "Does this diskette need to be formatted?"
  906.    Style attribute 48                                         ; Black on cyan
  907.    @  7,10 ?? "You will need a formatted "+DiskSize+"-inch double-sided, "+Density+"-"
  908.    @  8,10 ?? "density diskette (floppy disk)."
  909.    @ 10,10 ?? "Holding the diskette at the top (so that the manufacturer's"
  910.    @ 11,10 ?? "label is to the right, and the write-protect notch is to the"
  911.    @ 12,10 ?? "left), place it in your computer's floppy drive "+ Upper(WhereTo) +"."
  912.    @ 14,10 ?? "Pull down the lever at the top of the floppy drive.  (If"
  913.    @ 15,10 ?? "there is no lever, make certain that the diskette is firmly"
  914.    @ 16,10 ?? "in place.)"
  915.    Draw_Box("Wide", 15, 02, 13, 04, 65, "", "")  ; White on black
  916.    Style Attribute 11                            ; light cyan on black
  917.    Header = "BACKING   UP   " + Upper(SystemName) + "   SYSTEM"
  918.    @ 3,16 ??  Format("AC,CU,W48",Strval(Header))
  919.    Style attribute 03
  920.    @ 22,14 ?? "Press the <Enter> key when finished (or <Esc> to quit)."
  921.    Style Attribute 15                            ; white on black
  922.    @ 20,26 ?? "Please answer Yes or No:   "      ; relates to the above question
  923.    Style Attribute 11 Accept "A3" Required picture "{YES,NO}" to YN
  924.    If retval = False                             ; Return if user pressed escape key
  925.       Then return
  926.       Else Check_TargetDrive()
  927.            If YN = "YES"
  928.               Then Please_Wait("Please wait while the diskette is being formatted.")
  929.                    Run NoRefresh "Format " + WhereTo + ": <Backup.Txt >Nul"
  930.            Endif
  931.            Please_Wait("Please wait until light goes out and you hear a beep")
  932.            If not Match(WhichDir,"..\\")                             ; Missing trailing
  933.               then WhichDir = WhichDir + "\\"                        ; Backslash
  934.            Endif
  935.            If Upper(Whichfiles) = "ALL"                              ; Establish which
  936.               Then WhichFiles = ""                                   ; files are copied
  937.            Endif
  938.            WhichFiles = WhichDir + WhichFiles + "*.db "
  939.            Run Big NoRefresh "Copy " + WhichFiles                    ; Copy designated
  940.                             + WhereTo + ":>Nul"                      ; files to diskette
  941.    Endif
  942.    Beep                     ; Beep to advise user that backup is finished
  943. Endproc
  944.  
  945. Proc Check_TargetDrive()  ;---Check whether or not the specified drive is ready
  946.    Private Keypressed
  947.    Cursor off Clear_Canvas()
  948.    If not Drivestatus(Whereto)
  949.       Then Draw_Box("Wide", 63, 03, 11, 21, 64, "", "")  Style attribute 48
  950.            @ 11,15 ?? "Please make sure that the diskette is placed"
  951.            @ 12,15 ?? "in your computer's floppy drive " + Upper(Whereto) + ".  Pull"
  952.            @ 13,15 ?? "down the lever at the top of the floppy"
  953.            @ 14,15 ?? "drive (or, if there is no lever, make"
  954.            @ 15,15 ?? "certain the diskette is firmly in place)."
  955.            Draw_Box("Wide", 15, 06, 20, 08, 56, "", "")
  956.            Style attribute 03
  957.            @ 18,26 ?? "Press any key when ready."
  958.            Style attribute 139               ; blinking text
  959.            @ 07,27 ?? "DRIVE " + Upper(Whereto) + " IS NOT READY !!!"
  960.            Keypressed = Getchar()
  961.    Endif
  962. Endproc
  963.  
  964. Proc Allocate_Diskette(WhichDir,PCType,WhereTo)  ; allocate files
  965.    Private Density,       ; Density of diskette (determined by argument PCType)
  966.            Header,        ; Heading (determined by argument SystemName)
  967.            YN             ; Whether or not user wants diskette formatted
  968.    If IsBlank(WhereTo)
  969.       Then Clear_Canvas()
  970.            Draw_Box("Wide", 63, 04, 04, 18, 76, "", "")
  971.            Style Attribute 03 @ 15,12 ?? " Press the <Enter> key when finished, or <Esc> to quit. "
  972.            Style Attribute 48 @ 07,23 ?? "Which drive will you place the diskette in?"
  973.            Style Attribute 63 @ 11,25 ?? "Please answer either A or B:  "
  974.            Style attribute 11 Accept "A1" Required Picture "A,B" To Whereto
  975.    EndIf
  976.    PcType = Upper(PCType)
  977.    Switch
  978.       Case PCType = "AT"
  979.         or PCType = "386"    : Density  = "high"
  980.                                Switch
  981.                                   Case WhereTo = "A": Disksize = "5 1/4"
  982.                                   Case WhereTo = "B": Disksize = "3 1/2"
  983.                                EndSwitch
  984.       Case PCType = "XT"     : Disksize = "5 1/4"
  985.                                Density  = "double"
  986.       Case PCType = "LAPTOP" : Disksize = "3 1/2"
  987.                                Density  = "double"
  988.    Endswitch
  989.    Clear_Canvas()
  990.    Draw_Box("Wide", 63, 00, 03, 24, 76, "", "")               ; White on cyan
  991.    @ 18,21 ?? "Does this diskette need to be formatted?"
  992.    Style attribute 48                                         ; Black on cyan
  993.    @  7,10 ?? "You will need a formatted "+DiskSize+"-inch double-sided, "+Density+"-"
  994.    @  8,10 ?? "density diskette (floppy disk)."
  995.    @ 10,10 ?? "Holding the diskette at the top (so that the manufacturer's"
  996.    @ 11,10 ?? "label is to the right, and the write-protect notch is to the"
  997.    @ 12,10 ?? "left), place it in your computer's floppy drive "+ Upper(WhereTo) +"."
  998.    @ 14,10 ?? "Pull down the lever at the top of the floppy drive.  (If"
  999.    @ 15,10 ?? "there is no lever, make certain that the diskette is firmly"
  1000.    @ 16,10 ?? "in place.)"
  1001.    Draw_Box("Wide", 15, 02, 13, 04, 65, "", "")  ; White on black
  1002.    Style Attribute 11                            ; light cyan on black
  1003.    Header = "MAKING ALLOCATION DISKETTE"
  1004.    @ 3,16 ??  Format("AC,CU,W48",Strval(Header))
  1005.    Style attribute 03
  1006.    @ 22,14 ?? "Press the <Enter> key when finished (or <Esc> to quit)."
  1007.    Style Attribute 15                            ; white on black
  1008.    @ 20,26 ?? "Please answer Yes or No:   "      ; relates to the above question
  1009.    Style Attribute 11 Accept "A3" Required picture "{YES,NO}" to YN
  1010.    If retval = False                             ; Return if user pressed escape key
  1011.       Then return
  1012.       Else Check_TargetDrive()
  1013.            If YN = "YES"
  1014.               Then Please_Wait("Please wait while the diskette is being formatted.")
  1015.                    Run NoRefresh "Format " + WhereTo + ": <Backup.Txt >Nul"
  1016.            Endif
  1017.            Please_Wait("Please wait until light goes out and you hear a beep")
  1018.            If not Match(WhichDir,"..\\")                             ; Missing trailing
  1019.               then WhichDir = WhichDir + "\\"                        ; Backslash
  1020.            Endif
  1021.            ; Copy designated files to diskette
  1022.            Run Big NoRefresh "Copy MakeRun\\*.Exe " + WhereTo + ":>Nul"
  1023.            Run Big NoRefresh "Copy MakeRun\\*.Bat " + WhereTo + ":>Nul"
  1024.    Endif
  1025.    Beep                     ; Beep to advise user that backup is finished
  1026. EndProc
  1027.  
  1028.  
  1029. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  1030. ; ║                             S A M P L E     U S A G E                                ║
  1031. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  1032. ; ║                                                                                      ║
  1033. ; ║ To create a runtime version meeting the following specifications:                    ║
  1034. ; ║                                                                                      ║
  1035. ; ║      System named Budget                                                             ║
  1036. ; ║                                                                                      ║
  1037. ; ║      To be invoked by typing ETS at the DOS prompt                                   ║
  1038. ; ║                                                                                      ║
  1039. ; ║      Accessing protected tables with password AGORA (all caps)                       ║
  1040. ; ║                                                                                      ║
  1041. ; ║      Incorporating files (other than tables) named Backup.txt, Budget.sc,            ║
  1042. ; ║      ExpGuide.doc, ExpSubs.sc, Splash.sc, and Utility.sc from subdirectory P         ║
  1043. ; ║                                                                                      ║
  1044. ; ║      Using tables named BgtMnth, BgtUpdat, and Expense from subdirectory D and       ║
  1045. ; ║      tables Printer, Signon, and Store from subdirectory L                           ║
  1046. ; ║                                                                                      ║
  1047. ; ║      Placing the application in a directory named Expenses on the user's hard drive  ║
  1048. ; ║                                                                                      ║
  1049. ; ║      Using a PC on which Paradox was installed in directory Pdox40 on drive C        ║
  1050. ; ║                                                                                      ║
  1051. ; ║      Using a file named Runtime.Zip (created as described at the beginning of this   ║
  1052. ; ║      article, and thus available to be automatically reused in each of your          ║
  1053. ; ║      applications) found in subdirectory Pdox40\Runtime on drive C                   ║
  1054. ; ║                                                                                      ║
  1055. ; ║      Using a 386 computer                                                            ║
  1056. ; ║                                                                                      ║
  1057. ; ║      Copying the runtime version to floppy drive A:                                  ║
  1058. ; ║                                                                                      ║
  1059. ; ║      Not creating a single executable file                                           ║
  1060. ; ║                                                                                      ║
  1061. ; ║ Simply invoke the following procedure call:                                          ║
  1062. ; ║                                                                                      ║
  1063. ; ║      Make_Runtime("Budget"                                                           ║
  1064. ; ║                   "ETS",                                                             ║
  1065. ; ║                   "AGORA",                                                           ║
  1066. ; ║                   "Budget"                                                           ║
  1067. ; ║                   "{P\\Backup.txt}{P\\Budget.sc}{P\\ExpGuide.doc}                    ║
  1068. ; ║                    {P\\Expsubs.sc}{P\\Splash.sc}{P\\Utility.sc}",                    ║
  1069. ; ║                   "{D\\BgtMnth}{D\\BgtUpdat}{D\\Expense}{L\\Printer}{L\\Signon}      ║
  1070. ; ║                    {L\\Store}",                                                      ║
  1071. ; ║                   "Expenses",                                                        ║
  1072. ; ║                   "C:\\Pdox40",                                                      ║
  1073. ; ║                   "C:\\Pdox40\\Runtime",                                             ║
  1074. ; ║                   "386",                                                             ║
  1075. ; ║                   "A")                                                               ║
  1076. ; ║                   "No")                                                              ║
  1077. ; ║                                                                                      ║
  1078. ; ║  As a rule, this would be invoked from your system's main menu ... For example,      ║
  1079. ; ║  provide a menu option to create a runtime version, and invoke a procedure call      ║
  1080. ; ║  (such as the one above) whenever that is selected.                                  ║
  1081. ; ║                                                                                      ║
  1082. ; ╚══════════════════════════════════════════════════════════════════════════════════════╝
  1083.  
  1084.  
  1085. ; ╔══════════════════════════════════════════════════════════════════════════════════════╗
  1086. ; ║                                V A R I A T I O N S                                   ║
  1087. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  1088. ; ║                                                                                      ║
  1089. ; ║   This utility was designed to fully automate the runtime procedure and delete all   ║
  1090. ; ║   unnecessary files.  However, should you prefer to keep the runtime system in a     ║
  1091. ; ║   subdirectory, simply uncomment lines ZZZ and ZZZ:                                  ║
  1092. ; ║                                                                                      ║
  1093. ; ║            Run "Del MakeRun\\*.*"                                                    ║
  1094. ; ║            Run "RD MakeRun"                                                          ║
  1095. ; ║                                                                                      ║
  1096. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  1097. ; ║                                                                                      ║
  1098. ; ║   If you had a single executable file created but want to keep both versions - one   ║
  1099. ; ║   for modem transfers and another for diskettes - simply uncomment lines             ║
  1100. ; ║   ZZZ and ZZZ:                                                                       ║
  1101. ; ║            Run "Del Install.Bat"                                                     ║
  1102. ; ║            Run "Del ZipFiles. Exe"                                                   ║
  1103. ; ║                                                                                      ║
  1104. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  1105. ; ║                                                                                      ║
  1106. ; ║   Version 2.04C of PkZip enables one to copy zipped files that exceed the size of    ║
  1107. ; ║   a single diskette.                                                                 ║
  1108. ; ║                                                                                      ║
  1109. ; ║   If one individual file (e. g., a single table) within the zipped file exceeds      ║
  1110. ; ║   the size of a diskette, shareware programs are available to split a file in        ║
  1111. ; ║   two.  They can then be joined back together with either another shareware          ║
  1112. ; ║   program, or a batch file containing the command DOS Copy /B File1+File2 File.      ║
  1113. ; ║                                                                                      ║
  1114. ; ║                                                                                      ║
  1115. ; ║   For example, "PC Magazine" provides two utilities ("Slice" and "Splice") to        ║
  1116. ; ║   transfer files that will not fit on a single diskette.  Both are included in       ║
  1117. ; ║   their book (DOS 5 Techniques and Utilities), and available on their CompuServe     ║
  1118. ; ║   forum (ZiffNet).                                                                   ║
  1119. ; ║                                                                                      ║
  1120. ; ║      Slice breaks large files into pieces and copies it to the required number of    ║
  1121. ; ║      diskettes.  The format is Slice Filename TargetDrive - e. g., to split a        ║
  1122. ; ║      file named MyFile.Zip to diskettes in drive A:                                  ║
  1123. ; ║                                                                                      ║
  1124. ; ║            Slice MyFile.Zip A:                                                       ║
  1125. ; ║               │     │        │                                                       ║
  1126. ; ║               │     │        └─ Target drive containing diskette                     ║
  1127. ; ║               │     └────────── Name and extension of file to be copied              ║
  1128. ; ║               └──────────────── Word Slice                                           ║
  1129. ; ║                                                                                      ║
  1130. ; ║      Splice reconstructs the divided files, using format SourceDrive:\Splice         ║
  1131. ; ║      SourceDrive: TargetDrive\TargetDirectory - e. g., to copy the above spliced     ║
  1132. ; ║      file from a diskette in Drive A to directory c:\MyDir:                          ║
  1133. ; ║                                                                                      ║
  1134. ; ║            A:\Splice A: C:\MyDir                                                     ║
  1135. ; ║            │ │  │    │    │                                                          ║
  1136. ; ║            │ │  │    │    └─ Target drive and directory to which to copy file        ║
  1137. ; ║            │ │  │    └────── Source drive (containing the diskette)                  ║
  1138. ; ║            │ │  └─────────── Word Splice                                             ║
  1139. ; ║            │ └────────────── Backslash                                               ║
  1140. ; ║            └──────────────── Source drive (containing the diskette)                  ║
  1141. ; ║                                                                                      ║
  1142. ; ╟──────────────────────────────────────────────────────────────────────────────────────╢
  1143. ; ║                                                                                      ║
  1144. ; ║   For maximum efficiency, all Paradox procedures should be written to libraries.     ║
  1145. ; ║   This step has been omitted from this script solely to ensure that it can easily    ║
  1146. ; ║   be used and mastered by novices as well as experienced developers.  However,       ║
  1147. ; ║   once you have become adept at using libraries, the standard techniques should      ║
  1148. ; ║   be employed to incorporate these procedures after they have been tested and        ║
  1149. ; ║   modified to meet your needs.                                                       ║
  1150. ; ║                                                                                      ║
  1151. ; ║   When declaring the autolib, make certain to include the full path ... e. g.,       ║
  1152. ; ║   Autolib = (Directory() + "\\ETS") for an autolib named ETS.  (The path is          ║
  1153. ; ║   necessary to enable the utility to locate the libraries from both the original     ║
  1154. ; ║   directory and the temporary MakeRun subdirectory.                                  ║
  1155. ; ║                                                                                      ║
  1156. ; ╚══════════════════════════════════════════════════════════════════════════════════════╝
  1157.